﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EntityModule
{
    public partial class New
    {
        public int PageCount { get; set; }
        public int udImageTitle { get; set; }
        public string udAuthor
        {
            get { return UserID == null ? "<a target=\"blank\" href=\" " + this.Link + " \">VnExpress</a>" : this.User.Name; }
        }
        public string udHour
        {
            get
            {
                if (this.DateModifier.HasValue && DateModifier.Value.Date == DateTime.Now.Date)
                    return DateTime.Now.Subtract(DateModifier.Value).TotalMinutes < 60 ? Math.Round(DateTime.Now.Subtract(DateModifier.Value).TotalMinutes, 0) + "m" : Math.Round(DateTime.Now.Subtract(DateModifier.Value).TotalHours, 0) + "h";
                return DateModifier.Value.ToString("dd/MM/yyyy");
            }
        }
    }
    public partial class NewsDetail
    {
        public string udTilte
        {
            get { return this.New.Tilte; }
        }
        public string udAuthor
        {
            get { return this.New.udAuthor; }
        }
        public string Link
        {
            get
            {
                return this.New.Link;
            }
        }

        public string LinkCurrentPage { get; set; }
    }
}
